Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add case/switch statement code smell #49

Closed

Conversation

Chris-May
Copy link
Contributor

I recently helped someone with this code smell, and thought it could be good to add to the website, especially to highlight that case or switch statements aren't necessarily "bad," but that they could be hiding something better.

@emilybache
Copy link
Member

Hi Chris, I must apologise for not noticing your PR earlier. Thanks for taking the time. The thing is, we already have a code smell "Repeated Switches" (https://sammancoaching.org/code_smells/repeated_switches.html). The smell you refer to as "Case or Switch Statements" I think is from the first edition of Martin Fowler's Refactoring book. It is changed in the second edition to "Repeated Switches". I don't think it's necessary to have both.

@emilybache emilybache closed this Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants